package cn.j229.bug.zhongxuan.hualian.service.impl;

import cn.j229.bug.zhongxuan.hualian.mapper.UserMapper;
import cn.j229.bug.zhongxuan.hualian.pojo.User;
import cn.j229.bug.zhongxuan.hualian.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;

/**
 * @Author smile_ZhongXuan
 * @Date 2020/10/21 10:21
 * @Version 1.0
 */
@Service("userService")
public class UserServiceImpl implements UserService {
    @Resource
    UserMapper userMapper = null;

    @Override
    public User findUserByPhone(String phone) {
        User user = new User();
        user.setPhone(phone);
        return userMapper.selectOne(user);
    }

    @Override
    public int insertUserSelective(User user) {
        user.setRegDate(new Date());
        return userMapper.insertSelective(user);
    }

}
